from selenium import webdriver
import time
# 打开谷歌浏览器
driver = webdriver.Chrome()
# 设置最大行
driver.maximize_window()
# 设置隐式等待
driver.implicitly_wait(10)
# 设置宽和高
# driver.set_window_size(480, 800)
# 打开网页
driver.get("http://novel.hctestedu.com/")
# 定位搜索框
# search_element = driver.find_element_by_id('searchKey')
# search_element.send_keys('我的反派生涯')
# driver.find_element_by_id('btnSearch').click()
# 定位登录
driver.find_element_by_class_name('mr15').click()
time.sleep(3)  # 睡三秒
driver.find_element_by_id('txtUName').send_keys('13838529341')
driver.find_element_by_id('txtPassword').send_keys('123456')
driver.find_element_by_id('btnLogin').click()
# 后退
# driver.back()
# 前进
# time.sleep(3)
# driver.forward()
time.sleep(3)
# 刷新
driver.refresh()
